package com.fw.system.admin.service.impl;

import java.util.List;
import com.fw.common.IdXD;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.fw.system.admin.mapper.TbMoneysMapper;
import com.fw.system.admin.domain.TbMoneys;
import com.fw.system.admin.service.ITbMoneysService;
import com.fw.utils.DateUtils;

/**
 * 钱包Service业务层处理
 * 
 * @author xxx
 * @date 2021-12-03
 */
@Service
public class TbMoneysServiceImpl extends ServiceImpl<TbMoneysMapper, TbMoneys> implements ITbMoneysService
{
    @Autowired
    private TbMoneysMapper tbMoneysMapper;

    @Autowired
    private IdXD idXD;

    /**
     * 查询钱包
     * 
     * @param id 钱包ID
     * @return 钱包
     */
    @Override
    public TbMoneys selectTbMoneysById(String id)
    {
        return tbMoneysMapper.selectTbMoneysById(id);
    }

    /**
     * 查询钱包列表
     * 
     * @param tbMoneys 钱包
     * @return 钱包
     */
    @Override
    public List<TbMoneys> selectTbMoneysList(TbMoneys tbMoneys)
    {
        return tbMoneysMapper.selectTbMoneysList(tbMoneys);
    }

    /**
     * 新增钱包
     * 
     * @param tbMoneys 钱包
     * @return 结果
     */
    @Override
    public int insertTbMoneys(TbMoneys tbMoneys)
    {
        tbMoneys.setCreateTime(DateUtils.getNowDate());
        tbMoneys.setId(idXD.nextId());
        return tbMoneysMapper.insertTbMoneys(tbMoneys);
    }

    /**
     * 修改钱包
     * 
     * @param tbMoneys 钱包
     * @return 结果
     */
    @Override
    public int updateTbMoneys(TbMoneys tbMoneys)
    {
        return tbMoneysMapper.updateTbMoneys(tbMoneys);
    }

    /**
     * 批量删除钱包
     * 
     * @param ids 需要删除的钱包ID
     * @return 结果
     */
    @Override
    public int deleteTbMoneysByIds(String[] ids)
    {
        return tbMoneysMapper.deleteTbMoneysByIds(ids);
    }

    /**
     * 删除钱包信息
     * 
     * @param id 钱包ID
     * @return 结果
     */
    @Override
    public int deleteTbMoneysById(String id)
    {
        return tbMoneysMapper.deleteTbMoneysById(id);
    }
}
